<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/TextPlugin.min.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        .box1 {
            height: 100vh;
            background-color: #eee;
            display: flex;
            align-items: center;
            justify-content: stretch;
        }
        .letter-group {
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            align-content: center;
            flex-wrap: wrap;
            padding: 0 10vw;
        }
        .letter-group span {
            opacity: 0;
            font-size: 1.8rem;
            font-weight: bold;
            margin: 2.4vh 1.2vw;
        }
        .letter-group span::after {
            content: '>';
        }
        .letter-group span::before {
            content: '<'
        }
        .letterA {
            transform: scale(2) translateY(-5vh);
        }
        .letterB {
            transform: scale(3) translateY(5vh);
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <div class="box1"></div>
        <div class="letter-group">
            <span class="letterA" name="html">html</span>
            <span class="letterB" name="c++">c++</span>
            <span class="letterA" name="Python">Python</span>
            <span class="letterB" name="Python">Python</span>
            <span class="letterA" name="Python">Python</span>
            <span class="letterB" name="Python">Python</span>
            <span class="letterA" name="Python">Python</span>
            <span class="letterB" name="Python">Python</span>
            <span class="letterA" name="Python">Python</span>
            <span class="letterB" name="Python">Python</span>
            <span class="letterA" name="Python">Python</span>
            <span class="letterB" name="Python">Python</span>
            <span class="letterA" name="Python">Python</span>
        </div>
        <div class="box1"></div>
        
        
      </div>

    <!-- <button id="animate">animate</button> -->
    <script>
        // use a script tag or an external JS file
        document.addEventListener("DOMContentLoaded", (event) => {
            gsap.registerPlugin(ScrollTrigger,TextPlugin)
            let timeline1 = gsap.timeline({
                scrollTrigger: {
                    trigger: ".letter-group",
                    scrub: .5,
                    start: "bottom 100%",
                    end: "bottom 30%",
                    pin: true,
                    markers: true
                }
            })
            timeline1
                .to('.letter-group > span', {opacity: 1, y: 0, scale: 1})
                .to('.letter-group > span', {})
        });
       
       </script>
</body>
</html>